<?php /* Smarty version Smarty-3.1.12, created on 2013-06-03 22:57:31
         compiled from "D:\redwazi2\sys-admin\template\goods\category_list.htm" */ ?>
<?php /*%%SmartyHeaderCode:2522051acacd7db8e48-27677887%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'e87ee8c48a04a675451653eb0643ebee4278eedd' => 
    array (
      0 => 'D:\\redwazi2\\sys-admin\\template\\goods\\category_list.htm',
      1 => 1370271188,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2522051acacd7db8e48-27677887',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_51acacd80fd2d8_57202153',
  'variables' => 
  array (
    'categorys' => 0,
    'category' => 0,
    'child1' => 0,
    'child2' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_51acacd80fd2d8_57202153')) {function content_51acacd80fd2d8_57202153($_smarty_tpl) {?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="/sys-admin/css/general.css" rel="stylesheet" type="text/css">
<link href="/sys-admin/css/main.css" rel="stylesheet" type="text/css">
<script src="/sys-admin/js/jquery.js" type="text/javascript"></script>
</head>
<body>
<h1>
<span class="action-span"><a href="/sys-admin/action/goods/category.php?met=addui">添加父分类</a></span>
<span class="action-span1">商品分类管理</span>
</h1>
<div class="list-div">
<table cellpadding="2" cellspacing="1" width="100%">
  <tbody><tr>
    <th>编号</th>
    <th>名称</th>
    <th width="5%">单位</th>
    <th width="5%">导航栏显示</th>
    <th width="5%">是否显示</th>
    <th width="10%">排序</th>
    <th width="20%">操作</th>
  </tr>
  <?php  $_smarty_tpl->tpl_vars['category'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['category']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['categorys']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['category']->key => $_smarty_tpl->tpl_vars['category']->value){
$_smarty_tpl->tpl_vars['category']->_loop = true;
?>
  <tr id="c_<?php echo $_smarty_tpl->tpl_vars['category']->value['cat_id'];?>
">
    <td class="num"><?php echo $_smarty_tpl->tpl_vars['category']->value['cat_id'];?>
</td>
    <td class="fwb">
    	<img src="/sys-admin/images/menu_minus.gif">
        <span><a href=""><?php echo $_smarty_tpl->tpl_vars['category']->value['cat_name'];?>
</a></span>
    </td>
    <td><?php echo $_smarty_tpl->tpl_vars['category']->value['cat_unit'];?>
</td>
    <td><?php if ($_smarty_tpl->tpl_vars['category']->value['is_show_nav']==1){?><img src="/sys-admin/images/yes.gif"><?php }else{ ?><img src="/sys-admin/images/no.gif"><?php }?></td>
    <td><?php if ($_smarty_tpl->tpl_vars['category']->value['is_show']==1){?><img src="/sys-admin/images/yes.gif"><?php }else{ ?><img src="/sys-admin/images/no.gif"><?php }?></td>
    <td><?php echo $_smarty_tpl->tpl_vars['category']->value['sort_order'];?>
</td>
    <td>
      <a href="/sys-admin/action/goods/category.php?met=editui&id=<?php echo $_smarty_tpl->tpl_vars['category']->value['cat_id'];?>
">编辑</a> |
      <a href="javascript:delCategory('<?php echo $_smarty_tpl->tpl_vars['category']->value['cat_name'];?>
',<?php echo $_smarty_tpl->tpl_vars['category']->value['cat_id'];?>
);">移除</a> |
      <a href="/sys-admin/action/goods/category.php?met=addui&pid=<?php echo $_smarty_tpl->tpl_vars['category']->value['cat_id'];?>
">加子分类</a>
    </td>
  </tr>
  <?php if (count($_smarty_tpl->tpl_vars['category']->value['childs'])>0){?>
	  <?php  $_smarty_tpl->tpl_vars['child1'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['child1']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['category']->value['childs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['child1']->key => $_smarty_tpl->tpl_vars['child1']->value){
$_smarty_tpl->tpl_vars['child1']->_loop = true;
?>
	  <tr id="c_<?php echo $_smarty_tpl->tpl_vars['category']->value['cat_id'];?>
_<?php echo $_smarty_tpl->tpl_vars['child1']->value['cat_id'];?>
">
	    <td class="num"><?php echo $_smarty_tpl->tpl_vars['child1']->value['cat_id'];?>
</td>
	    <td class="fwb">
	        <span class="pl15"></span>
	    	<img src="/sys-admin/images/menu_minus.gif">
	        <span><a href=""><?php echo $_smarty_tpl->tpl_vars['child1']->value['cat_name'];?>
</a></span>
	    </td>
	    <td><?php echo $_smarty_tpl->tpl_vars['child1']->value['cat_unit'];?>
</td>
	    <td><?php if ($_smarty_tpl->tpl_vars['child1']->value['is_show_nav']==1){?><img src="/sys-admin/images/yes.gif"><?php }else{ ?><img src="/sys-admin/images/no.gif"><?php }?></td>
	    <td><?php if ($_smarty_tpl->tpl_vars['child1']->value['is_show']==1){?><img src="/sys-admin/images/yes.gif"><?php }else{ ?><img src="/sys-admin/images/no.gif"><?php }?></td>
	    <td><?php echo $_smarty_tpl->tpl_vars['child1']->value['sort_order'];?>
</td>
	    <td>
	      <a href="/sys-admin/action/goods/category.php?met=editui&id=<?php echo $_smarty_tpl->tpl_vars['child1']->value['cat_id'];?>
">编辑</a> |
	      <a href="javascript:delCategory('<?php echo $_smarty_tpl->tpl_vars['child1']->value['cat_name'];?>
',<?php echo $_smarty_tpl->tpl_vars['child1']->value['cat_id'];?>
);">移除</a> |
	      <a href="/sys-admin/action/goods/category.php?met=addui&pid=<?php echo $_smarty_tpl->tpl_vars['child1']->value['cat_id'];?>
">加子分类</a>
	    </td>
	  </tr>
	  <?php if (count($_smarty_tpl->tpl_vars['child1']->value['childs'])>0){?>
	  	  <?php  $_smarty_tpl->tpl_vars['child2'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['child2']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['child1']->value['childs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['child2']->key => $_smarty_tpl->tpl_vars['child2']->value){
$_smarty_tpl->tpl_vars['child2']->_loop = true;
?>
		  <tr id="c_<?php echo $_smarty_tpl->tpl_vars['category']->value['cat_id'];?>
_<?php echo $_smarty_tpl->tpl_vars['child1']->value['cat_id'];?>
_<?php echo $_smarty_tpl->tpl_vars['child2']->value['cat_id'];?>
">
		    <td class="num"><?php echo $_smarty_tpl->tpl_vars['child2']->value['cat_id'];?>
</td>
		    <td class="fwb">
		        <span class="pl30"></span>
		    	<img src="/sys-admin/images/menu_minus.gif">
		        <span><a href=""><?php echo $_smarty_tpl->tpl_vars['child2']->value['cat_name'];?>
</a></span>
		    </td>
		    <td><?php echo $_smarty_tpl->tpl_vars['child2']->value['cat_unit'];?>
</td>
		    <td><?php if ($_smarty_tpl->tpl_vars['child2']->value['is_show_nav']==1){?><img src="/sys-admin/images/yes.gif"><?php }else{ ?><img src="/sys-admin/images/no.gif"><?php }?></td>
		    <td><?php if ($_smarty_tpl->tpl_vars['child2']->value['is_show']==1){?><img src="/sys-admin/images/yes.gif"><?php }else{ ?><img src="/sys-admin/images/no.gif"><?php }?></td>
		    <td><?php echo $_smarty_tpl->tpl_vars['child2']->value['sort_order'];?>
</td>
		    <td>
		      <a href="/sys-admin/action/goods/category.php?met=editui&id=<?php echo $_smarty_tpl->tpl_vars['child2']->value['cat_id'];?>
">编辑</a> |
		      <a href="javascript:delCategory('<?php echo $_smarty_tpl->tpl_vars['child2']->value['cat_name'];?>
',<?php echo $_smarty_tpl->tpl_vars['child2']->value['cat_id'];?>
);">移除</a>
		    </td>
		  </tr>
		  <?php } ?>
	  <?php }?>
	  <?php } ?>
  <?php }?>
  <?php } ?>
  </tbody></table>
</div>
<script type="text/javascript">
function delCategory(name,id){
	if(confirm("您确定要删除'"+name+"'?")){
		$.get('/sys-admin/action/goods/category.php?met=delete&id='+id+'&t='+(new Date().getTime()),null,function(result){
			if($.trim(result) == "1"){
				alert("删除'"+name+"'成功");
				document.location.reload();
			}else if($.trim(result) == "2"){
				alert("存在子分类，请先移除子分类");
			}else{
				alert("删除'"+name+"'失败");
			}
		});
	}
}
</script>
</body></html><?php }} ?>